//
//  KInvoices.m
//  KutulusLaw
//
//  Created by Mahmood1 on 12/10/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "KInvoicesDTO.h"

@implementation KInvoicesDTO
@synthesize createBy = _createBy, imgFile = _imgFile;

- (id)init {
	self = [super init];
	
	if (self) {
		self.createBy = @"";
		self.imgFile = @"";
	}
	
	return self;
}
- (id)initWithDictionary:(NSDictionary *)dictionary {
	self = [super initWithDictionary:dictionary];
	
	if (self) {
		
		if ([dictionary objectForKey:kKEY_CREATE_BY]) {
			self.createBy = [dictionary objectForKey:kKEY_CREATE_BY] ;
		}
		
		if ([dictionary objectForKey:@"pdf_file"]) {
			self.filePDF = [dictionary objectForKey:@"pdf_file"];
		}
		
		if ([dictionary objectForKey:kKEY_IMG_FILE]) {
			self.imgFile = [dictionary objectForKey:kKEY_IMG_FILE] ;
		}

	}
	
	return self;
}

- (id)copy {
    KInvoicesDTO *searchFileDTO = [[KInvoicesDTO alloc] init ];
    if (searchFileDTO) {
		searchFileDTO.ID = self.ID;
		searchFileDTO.userID = self.userID;
		searchFileDTO.name = [self.name copy];
		searchFileDTO.postDate = self.postDate;
		searchFileDTO.filePDF = [self.filePDF copy];	
		searchFileDTO.postDateText= [self.postDateText copy];
		searchFileDTO.createBy = [self.createBy copy];
		searchFileDTO.imgFile = [self.imgFile copy];
    }
    return self;
}

@end
